package client;


import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

public class setImage extends JPanel
{
	BufferedImage image;
	
	public setImage(String str) 
	{
		try   
		{
			if(str.equals("catalogManaging"))
				 image = ImageIO.read(this.getClass().getResource("catalogManaging.jpg"));
			if(str.equals("order"))
				 image = ImageIO.read(this.getClass().getResource("order.jpg"));
			if(str.equals("catalog"))
				 image = ImageIO.read(this.getClass().getResource("catalog.jpg"));
			if(str.equals("Cart"))
				 image = ImageIO.read(this.getClass().getResource("cartbig.jpg"));
			if(str.equals("customItem"))
				 image = ImageIO.read(this.getClass().getResource("customItem.jpg"));
			if(str.equals("login"))
				 image = ImageIO.read(this.getClass().getResource("background.jpg"));
			if(str.equals("conf"))
				image = ImageIO.read(this.getClass().getResource("confBackground.jpg"));
			if(str.equals("MainScreen"))
				image = ImageIO.read(this.getClass().getResource("MainScreenBackground.jpg"));
			if(str.equals("Search"))
				image = ImageIO.read(this.getClass().getResource("Search.jpg"));
		}
		catch (IOException e) {e.printStackTrace();}
	}
	
	public void paintComponent(Graphics g) 
	{
		super.paintComponent(g);
		g.drawImage(image,0,0,this);
	}
}
